/**
 * Generali Solutions d'assurances - Tous droits réservés &copy; 2007 - 2010
 */

package fr.generali.accueilclient.opt.transco.builder;

import fr.generali.accueilclient.opt.transco.om.ITypeTransco;
import fr.generali.accueilclient.opt.transco.om.impl.DTOTypeTransco;

/**
 * @author Holmes Kelly
 */
public class DTOTypeTranscoBuilder extends DTOTypeTranscoBuilderBase<DTOTypeTranscoBuilder> {

    /**
     * constructeur
     */
    public DTOTypeTranscoBuilder() {
        super(new DTOTypeTransco());
    }

    /**
     * @return DTOTypeTranscoBuilder
     */
    public static DTOTypeTranscoBuilder dTOTypeTransco() {
        return new DTOTypeTranscoBuilder();
    }

    /**
     * @return DTOTypeTransco
     */
    public ITypeTransco build() {
        return getInstance();
    }
}

/**
 * @author Holmes Kelly
 * @param <GeneratorT>
 */
class DTOTypeTranscoBuilderBase<GeneratorT extends DTOTypeTranscoBuilderBase<GeneratorT>> {

    /**
     * instance
     */
    private ITypeTransco instance;

    /**
     * @param aInstance instance
     */
    protected DTOTypeTranscoBuilderBase(ITypeTransco aInstance) {
        instance = aInstance;
    }

    /**
     * @return instance
     */
    protected ITypeTransco getInstance() {
        return instance;
    }

    /**
     * @param aValue dossier
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildDossier(String aValue) {
        instance.setDossier(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue transco
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildTransco(String aValue) {
        instance.setTransco(aValue);

        return (GeneratorT ) this;
    }
}
